package Map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo2 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("语文",96);
        map.put("数学",95);
        map.put("英语",99);
        map.put("物理",90);
        map.put("化学",88);
        map.put("历史",null);

        System.out.println(map);
        Integer value = map.get("语文");
        System.out.println(value);
        value = map.get("体育");
        System.out.println(value);

        System.out.println("map的大小:"+map.size());
        System.out.println("map为空否:"+map.isEmpty());

        System.out.println(map.containsKey("语文"));
        System.out.println(map.containsValue(99));
        value = map.remove("历史");
        System.out.println(value);
        System.out.println(map);
        map.clear();
        System.out.println(map);



    }
}
